/*
 * Copyright (C) 2008 Chris Bellew
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

#import <CoreFoundation/CoreFoundation.h>
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import <UIKit/UIPreferencesTable.h>
#import <UIKit/UIPreferencesTableCell.h>
#import <UIKit/UIPreferencesTextTableCell.h>
#import <UIKit/UISwitchControl.h>
#import <UIKit/UINavBarButton.h>

#define NAVBAR_HEIGHT 44.0

@interface iDynDNSSettingsView : UIView
{
	UIView* _mainView;
	UIPreferencesTable *_prefTable;
	UINavigationBar *_navigationBar;
	
    UIPreferencesTableCell *_updateCell;
    UIPreferencesTableCell *_updateIntervalCell;
    UIPreferencesTableCell *_autoUpdateCell;
    UIPreferencesTableCell *_lastUpdateDateCell;
	UIPreferencesTableCell *_currentIPCell;
	
	UIPreferencesTextTableCell *_usernameCell;
	UIPreferencesTextTableCell *_passwordCell;
	UIPreferencesTextTableCell *_hostnameCell;
	UISwitchControl *_autoUpdateControl;

    UINavBarButton *_updateIPButton;
    BOOL _updateInProgress;
    
	NSTimer *timer;
    
    BOOL _wiFiOn;

}

+ (iDynDNSSettingsView *)sharedInstance;

- (void)_removeKeyboard;

- (void)doUpdate;

- (UIPreferencesTable*)prefTable;

- (id)checkForWiFiChange:(NSTimer *)timer;

@end
